<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Database Performance Dashboard</title>
    </h:head>
    <h:body>
        <ui:composition template="projectTemplate.xhtml">
            <ui:define name="top"><h1>Database Performance Dashboard</h1></ui:define>
            
            <ui:define name="content">
                <p:growl id="growl" showDetail="true" life="3000" />
                <h:form>
                    <h:panelGrid columns="2">
                        <p:panel header="Shared Pool">
                            <p:meterGaugeChart id="sharedpool" value="#{sharedPoolChartBean.meterGaugeModel}" showTickLabels="true" labelHeightAdjust="90"  
                                               intervalOuterRadius="80" seriesColors="cc6666, E7E658, 66cc66" style="width:363px;height:200px"/>  
                            <h:panelGrid columns="2" >
                                <h:outputLabel for="sharedpoolvalue" value="Shared Pool (%): " />  
                                <p:inputText id="sharedpoolvalue" value="#{sharedPoolChartBean.currentValueDisplay}" label="SharedPool" style="width:80px">  
                                </p:inputText>
                            </h:panelGrid>
                            <h:panelGrid columns="1" >
                                <p:commandLink id="sharedpoolview" action="#{sharedPoolController.processViewMore()}" ajax="false">
                                    <h:outputText value="View breakdown" />  
                                </p:commandLink>
                                <p:commandLink id="sharedpoolinit" action="#{sharedPoolController.obtainInitParameter()}" oncomplete="sharedPoolDialog.show()">
                                    <h:outputText value="View parameter info" />  
                                </p:commandLink>
                                
                                <p:dialog header="Parameter value in init.ora" showEffect="fade" widgetVar="sharedPoolDialog" modal="true" >
                                    <p:outputPanel id="sharedPoolPanel">
                                        <h:panelGrid columns="2" cellpadding="5" >
                                            <h:outputLabel for="sharedPoolname" value="Parameter name: " />
                                            <h:outputText id="sharedPoolname" value="#{sharedPoolController.spParamObj.name}" />

                                            <h:outputLabel for="sharedPoolvalue" value="Parameter value: " />
                                            <h:outputText id="sharedPoolvalue" value="#{sharedPoolController.spParamObj.value}" />
                                        </h:panelGrid>
                                    </p:outputPanel>
                                </p:dialog>
                            </h:panelGrid>
                            
                            <p:poll interval="330" listener="#{sharedPoolChartBean.displayNewValue()}" update="sharedpool, sharedpoolvalue" />
                            
                        </p:panel>

                        <p:panel header="Buffer Cache" >
                            <p:meterGaugeChart id="buffercache" value="#{bufferCacheChartBean.meterGaugeModel}" showTickLabels="true" labelHeightAdjust="90"  
                                intervalOuterRadius="80" seriesColors="cc6666, E7E658, 66cc66" style="width:363px;height:200px" />  
                            <h:panelGrid columns="2" >
                                <h:outputLabel for="buffercachevalue" value="Buffer Cache (%): " />  
                                <p:inputText id="buffercachevalue" value="#{bufferCacheChartBean.currentValueDisplay}" label="BufferCache" style="width:80px">  
                                </p:inputText>
                            </h:panelGrid>
                            <h:panelGrid columns="1" >
                                <p:commandLink id="buffercacheview" action="#{bufferCacheController.processViewMore()}" ajax="false">
                                    <h:outputText value="  View breakdown" />  
                                </p:commandLink>
                                <p:commandLink id="buffercacheinit" action="#{bufferCacheController.obtainInitParameters()}" oncomplete="bufferCacheDialog.show()">
                                    <h:outputText value="View parameter info" />  
                                </p:commandLink>
                                
                                <p:dialog header="Parameter value in init.ora" showEffect="fade" widgetVar="bufferCacheDialog" modal="true" >
                                    <p:outputPanel id="bufferCachePanel">
                                        <h:panelGrid columns="2" cellpadding="5" >
                                            <h:outputLabel for="nameBuffer" value="Parameter name: " />
                                            <h:outputText id="nameBuffer" value="#{bufferCacheController.spParamObjBuffer.name}" />

                                            <h:outputLabel for="valueBuffer" value="Parameter value: " />
                                            <h:outputText id="valueBuffer" value="#{bufferCacheController.spParamObjBuffer.value}" />
                                            
                                            <h:outputLabel for="nameSize" value="Parameter name: " />
                                            <h:outputText id="nameSize" value="#{bufferCacheController.spParamObjSize.name}" />

                                            <h:outputLabel for="valueSize" value="Parameter value: " />
                                            <h:outputText id="valueSize" value="#{bufferCacheController.spParamObjSize.value}" />
                                        </h:panelGrid>
                                        <h:panelGrid columns="2" cellpadding="5" >
                                            
                                            <h:outputText id="nameCache" value="#{bufferCacheController.spParamObjCache.name}" />

                                            <h:outputText id="valueCache" value="#{bufferCacheController.spParamObjCache.value}" />
                                        </h:panelGrid>
                                    </p:outputPanel>
                                </p:dialog>
                            </h:panelGrid>
                            
                            <p:poll interval="330" listener="#{bufferCacheChartBean.displayNewValue()}" update="buffercache, buffercachevalue" />
                        </p:panel>

                        <p:panel header="Memory Area" >
                            <p:meterGaugeChart id="memoryarea" value="#{memoryAreaChartBean.meterGaugeModel}" showTickLabels="true" labelHeightAdjust="90"  
                                intervalOuterRadius="80" seriesColors="66cc66, E7E658, cc6666" style="width:363px;height:200px" />  
                            <h:panelGrid columns="2" >
                                <h:outputLabel for="memoryareavalue" value="Memory Area (%): " />  
                                <p:inputText id="memoryareavalue" value="#{memoryAreaChartBean.currentValueDisplay}" label="MemoryArea" style="width:80px">  
                                </p:inputText>
                            </h:panelGrid>
                            <h:panelGrid columns="1" >
                                <p:commandLink id="memoryareaview" action="#{sortMemoryController.processViewMore()}" ajax="false">
                                    <h:outputText value="  View breakdown" />  
                                </p:commandLink>
                                <p:commandLink id="memoryareainit" action="#{sortMemoryController.obtainInitParameters()}" oncomplete="memoryareaDialog.show()">
                                    <h:outputText value="View parameter info" />  
                                </p:commandLink>
                                
                                <p:dialog header="Parameter value in init.ora" showEffect="fade" widgetVar="memoryareaDialog" modal="true" >
                                    <p:outputPanel id="memoryareaPanel">
                                        <h:panelGrid columns="2" cellpadding="5" >
                                            <h:outputLabel for="memoryname" value="Parameter name: " />
                                            <h:outputText id="memoryname" value="#{sortMemoryController.spParamObj.name}" />

                                            <h:outputLabel for="memoryvalue" value="Parameter value: " />
                                            <h:outputText id="memoryvalue" value="#{sortMemoryController.spParamObj.value}" />
                                        </h:panelGrid>
                                    </p:outputPanel>
                                </p:dialog>
                            </h:panelGrid>
                            
                            <p:poll interval="330" listener="#{memoryAreaChartBean.displayNewValue()}" update="memoryarea, memoryareavalue" />
                        </p:panel>

                        <p:panel header="Rollback Segments" >
                            <p:meterGaugeChart id="rollback" value="#{rollbackChartBean.meterGaugeModel}" showTickLabels="true" labelHeightAdjust="90"  
                                intervalOuterRadius="80" seriesColors="66cc66, E7E658, cc6666" style="width:363px;height:200px" />  
                            <h:panelGrid columns="2" >
                                <h:outputLabel for="rollbackvalue" value="Rollback Segments (%): " />  
                                <p:inputText id="rollbackvalue" value="#{rollbackChartBean.currentValueDisplay}" label="Rollback" style="width:80px">  
                                </p:inputText>
                            </h:panelGrid>
                            <h:panelGrid columns="1" >
                                <p:commandLink id="rollbackview" action="#{rollbackSegmentController.processViewMore()}" ajax="false">
                                    <h:outputText value="  View breakdown" />  
                                </p:commandLink>
                                <p:commandLink id="rollbackinit" action="#{rollbackSegmentController.obtainInitParameters()}" oncomplete="rollbackDialog.show()">
                                    <h:outputText value="View parameter info" />  
                                </p:commandLink>
                                
                                <p:dialog header="Parameter value in init.ora" showEffect="fade" widgetVar="rollbackDialog" modal="true" >
                                    <p:outputPanel id="rollbackPanel">
                                        <h:panelGrid columns="2" cellpadding="5" >
                                            <h:outputLabel for="namerollback" value="Parameter name: " />
                                            <h:outputText id="namerollback" value="#{rollbackSegmentController.spParamObj.name}" />

                                            <h:outputLabel for="valuerollback" value="Parameter value: " />
                                            <h:outputText id="valuerollback" value="#{rollbackSegmentController.spParamObj.value}" />
                                        </h:panelGrid>
                                    </p:outputPanel>
                                </p:dialog>
                            </h:panelGrid>
                            
                            <p:poll interval="330" listener="#{rollbackChartBean.displayNewValue()}" update="rollback, rollbackvalue" />
                        </p:panel>
                        
                        <p:panel header="Redo Log Buffer" >
                            <p:meterGaugeChart id="redologbuffer" value="#{logBufferChartBean.meterGaugeModel}" showTickLabels="true" labelHeightAdjust="90"  
                                intervalOuterRadius="80" seriesColors="66cc66, E7E658, cc6666" style="width:363px;height:200px" />  
                            <h:panelGrid columns="2" >
                                <h:outputLabel for="redologbuffervalue" value="Log Buffer: " />  
                                <p:inputText id="redologbuffervalue" value="#{logBufferChartBean.currentValueDisplay}" label="LogBuffer" style="width:80px">  
                                </p:inputText>
                            </h:panelGrid>
                            <h:panelGrid columns="1" >
                                <p:commandLink id="redologbufferview" action="#{redoLogBufController.processViewMore()}" ajax="false">
                                    <h:outputText value="  View breakdown" />  
                                </p:commandLink>
                                <p:commandLink id="redologbufferinit" action="#{redoLogBufController.obtainInitParameters()}" oncomplete="logbufferDialog.show()">
                                    <h:outputText value="View parameter info" />  
                                </p:commandLink>
                                
                                <p:dialog header="Parameter value in init.ora" showEffect="fade" widgetVar="logbufferDialog" modal="true" >
                                    <p:outputPanel id="redologbufferPanel">
                                        <h:panelGrid columns="2" cellpadding="5" >
                                            <h:outputLabel for="logbuffername" value="Parameter name: " />
                                            <h:outputText id="logbuffername" value="#{redoLogBufController.spParamObj.name}" />

                                            <h:outputLabel for="logbuffervalue" value="Parameter value: " />
                                            <h:outputText id="logbuffervalue" value="#{redoLogBufController.spParamObj.value}" />
                                        </h:panelGrid>
                                    </p:outputPanel>
                                </p:dialog>
                            </h:panelGrid>
                            
                            <p:poll interval="330" listener="#{logBufferChartBean.displayNewValue()}" update="redologbuffer, redologbuffervalue" />
                        </p:panel>
                    </h:panelGrid>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>